<div id="wrapper" class="clearfix">
	<div class="container-fluid">
	  	<div class="row-fluid">
        	<div class="span3">
            	<?php
				$menus = $menus->getRawValue();
				foreach ($menus as $menu)
				{
					if ($menu['children'])
					{
				?>
                	<div class="cms_menu">
                    	<div class="cms_menu_title"><?php echo $menu['name']?></div>
                        <div class="cms_menu_wrapper">
						<?php
							foreach ($menu['children'] as $child)
							{
							?>
								<div class="cms_menu_item <?php echo ($child['cms_category_id']==$cms_category_id)?"cms_menu_item_active":""?>"><a href=""><?php echo $child['name']?></a></div>
							<?
							}
                        ?>
                		</div>
                	</div>
                <?php
					}
				}
				?>
            </div>
			<div class="span9">
        	<!--BEGIN Body content-->
        	<div class="row-fluid">
                <h3 class="title"><? echo (isset($cms_id)?($cms->name):($cms_category_default['name'])) ?></h3>
            </div>
            <div class="row-fluid">
            	<?php 
				
				if ($cms_category_default['template'] == '2') {
				?>
					<div class="box vtns-box-blue">
						<div class="title">
							<h4><span><?php echo __("Send email to us")?></span></h4>
						</div>
						<div class="content">
							<form class="form-horizontal" id="frmContact" action="<?php echo url_for('cms/permalink?cms_category_id='.$cms_category_default['cms_category_id'].'-'.vtnsSEO::getPermalink($cms_category_default['name'])) ?>">
								<div class="row-fluid">
									<div class="span6">
										<div class="form-row">
											<div class="span4">
												<label for="txt_name" class="form-label"><?php echo __("Name")?></label>
											</div>
											<div class="span8 controls">
												<input type='text' name="txt_name" id="txt_name" />
											</div>
										</div>
									</div>
									<div class="span6">
										<div class="form-row">
											<label for="txt_email" class="form-label span4">E-mail</label>
											<div class="span8 controls">
												<input type="text" name='txt_email' id="txt_email" />
											</div>
										</div>
									</div>
								</div>
								<div class="row-fluid">
									<div class="span12">
										<div class="form-row">
											<label for="txt_title" class="form-label span2"><?php echo __("Title")?></label>
											<div class="span10 controls">
												<input class="marginL5" type="text" name="txt_title" id="txt_title" />
											</div>
										</div>
									</div>
								</div>
								<div class="row-fluid">
									<div class="span12">
										<div class="form-row">
											<label for="txt_content" class="form-label span2"><?php echo __("Content")?></label>
											<div class="span10 controls">
												<textarea class="marginL5" name="txt_content" id="txt_content" style="height:200px;"></textarea>
											</div>
										</div>
									</div>
								</div>
								<div class="row-fluid marginT10">
									<div class="span5"></div>
									<div class="span7">
										<button type="submit" name="send" value="Send" class="btn btn-info"><span class="icon16 entypo-icon-email white"></span><?php echo __("Send mail")?></button>
									</div>
								</div>
								<div class="clearfix"></div>
							</form>
						</div>
					</div>
				<?
				}
				
				if ($cms_category_default['template'] == '1') {
					$count = 0;
					foreach ($cms_arr as $cms)
					{
						$count ++;
				?>
                	<div><a class="goToLink" href="#cms_<?=$count?>"><?=$count?>. <?=$cms['name']?></a></div>
                <?
					}
					?>
                    <div class="marginT10">
                    	<?php
						$count = 0;
						foreach ($cms_arr as $cms)
						{
								$count ++;
						?>
							<a id="cms_<?=$count?>"></a>
                            <div class="marginT10">
                            	<b><?php echo $count.". ".$cms['name'] ?></b> <br />
                                <p>
                                	<?php echo htmlspecialchars_decode($cms['content']) ?>
                                </p>
                            </div>
						<?
						}
						?>
                    </div>
                    <?
				} else {
					if (isset($cms)) echo htmlspecialchars_decode($cms->content);
				}
				?>
            </div>
		<!--END Body content-->
		</div>
	  </div>
	</div>
</div>
<script>
	$(document).ready(function()
	{
		$("a.goToLink").click(function()
		{
			goTo = $(this).attr("href");
			$('html, body').animate({
				 scrollTop:$(goTo).offset().top
			}, 500);
		});
		$("#frmContact").validate({
			rules: {
				txt_name: "required",
				txt_email: {
					required: true,
					email: true
				},
				txt_title: {
					required: true
				},
				txt_content: {
					required: true,
					minlength: 5
				}
			},
			messages: {
				txt_name: "<?php echo __("Please enter name")?>",
				txt_email: "<?php echo __("Please enter a valid email address")?>",
				txt_title: "<?php echo __("Please enter title")?>",
				txt_content: "<?php echo __("Please enter content")?>"
			}
		});
		
		<?php 
		if (isset($notify) && $notify != "")
		{
			if ($notify == "sendSuccess")
			{
				$type = "success";
				$title = "DONE";
				$text = __("You have sent mail success")." !.";
				$icon = "picon icon16 brocco-icon-info white";
			}
			?>
			$.pnotify({
				type: '<?=$type?>',
			    title: '<?=$title?>',
	    		text: '<?=$text?>',
			    icon: '<?=$icon?>',
			    opacity: 0.9,
			    history: false,
			    sticker: false
			});
			<?
		}
	?>
		
	});
</script>